package solution.design;

import java.util.List;

/**
 * @author zhangmin
 * @create 2021-09-23 10:50
 */
public class NestedInteger {
    private Integer val;
    private List<NestedInteger> list;

    public NestedInteger(Integer val) {
        this.val = val;
        this.list=null;
    }

    public NestedInteger(List<NestedInteger> list) {
        this.val=null;
        this.list = list;
    }

    // 如果其中存的是一个整数，则返回 true，否则返回 false
    public boolean isInteger(){
        return val!=null;
    }

    public Integer getInteger(){
        return this.val;
    }

    public List<NestedInteger> getList() {
        return list;
    }
}
